package com.best.oasis.settlement.service.department;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.best.oasis.settlement.common.entity.department.Department;
import com.best.oasis.settlement.common.so.department.DepartmentSO;
import com.best.oasis.settlement.common.vo.department.DepartmentVO;
import com.best.oasis.settlement.dao.department.DepartmentDao;
import com.best.oasis.settlement.service.base.BaseServiceImpl;
import com.best.oasis.settlement.util.page.PageList;

@Service
public class DepartmentServiceImpl extends BaseServiceImpl<Department, DepartmentVO, Long> implements DepartmentService {
	@Autowired
    private DepartmentDao departmentDao;
    
    @Override
    public void afterConstruct() {
        super.setBaseDao(departmentDao);
        super.setEntityClass(Department.class);
        super.setEntityVOClass(DepartmentVO.class);

    }

	@SuppressWarnings("unchecked")
	@Override
	public PageList<DepartmentVO> getPageList(DepartmentSO so) {
		PageList<DepartmentVO> result = new PageList<DepartmentVO>();
        result = orikaBeanMapper.convertPageList(departmentDao.getPageList(so), entityVOClass);
        return result;
	}

}
